package main

import "html/template"
import "log"
import "net/http"
import "os"

var tmpl *template.Template

func init() {
    data, err := Asset("data/hi.html")
    if err != nil {
        log.Fatal(err)
    }
    tmpl = template.Must(template.New("tmpl").Parse(string(data)))
}
func main() {
    tmpl.Execute(os.Stdout, map[string]string{"Name": "James"})
    http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
        tmpl.Execute(w, map[string]string{"Name": "James"})
    })
    log.Fatal(http.ListenAndServe(":8000", nil))
}

